﻿//----------------------------------------------------------------
// Copyright (c) 2011-2013 
// All rights reserved.
// Author: Ben DaoWei 
// Contact: bendaowei@gmail.com
// Web Link: http://xnaeditor.codeplex.com
// ----------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using MdxLib.Model;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace UnityEngine.Graphics.Shader
{
    public class Shader : IDisposable
    {
        ~Shader()
        {
            this.Dispose(false);
        }

        public void Dispose()
        {
            this.Dispose(true);
            GC.SuppressFinalize(this);
        }

        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                // do nothing
            }
        }

        private GraphicsDevice _GraphicsDevice;
        public GraphicsDevice GraphicsDevice
        {
            get
            {
                return _GraphicsDevice;
            }
            set
            {
                _GraphicsDevice = value;
            }
        }

        public Shader(GraphicsDevice device)
        {
            this.GraphicsDevice = device;
        }

        public virtual void LoadContent(ContentManager Content)
        {
        }

        public virtual void ResetDevice(GraphicsDevice device)
        {
            this.GraphicsDevice = device;
        }

        public virtual void Render()
        {
            SceneManager.Instance.ClearRenderQueue();
        }

        private bool _IsCreateShadow = false;
        public bool IsCreateShadow
        {
            get;
            set;
        }

        public Effect Effect
        {
            get;
            set;
        }

        public virtual Matrix[] Bones
        {
            set { }
        }

        public virtual bool UseBones
        {
            set { }
        }

        public virtual EMaterialLayerFilterMode FliterMode
        {
            set { }
        }

        public virtual Matrix EyeViewProjection
        {
            set { }
        }
        public virtual Matrix World
        {
            set { }
        }

        public virtual Matrix View
        {
            set { }
        }

        public virtual Matrix Projection
        {
            set { }
        }

        public virtual Texture2D ShadowMap
        {
            set { }
        }

        public virtual Texture2D Texture
        {
            set { }
        }

        public virtual float Alpha
        {
            set { }
        }

        public virtual bool TextureEnabled
        {
            set { }
        }

        public virtual float Fog
        {
            set { }
        }
    }
}
